<script lang="ts" setup>
import LContainer from '@/components/layout/LContainer.vue'

// 导入 FcDesigner
import FcDesigner from 'form-create-designer'
import type { Config } from 'form-create-designer'
import { ref } from 'vue'
// 组件引用
const designer = ref<InstanceType<typeof FcDesigner> | null>(null)

// 设计器配置
const designerConfig: Config = {
  fieldReadonly: false, // 字段是否只读
  showSaveBtn: true, // 显示保存按钮
  showDevice: false, // 不显示设备选择
  // showJsonPreview: false,
  hiddenItem: ['upload'],
}

// 保存处理函数
const handleSave = () => {
  if (designer.value) {
  }
}
</script>

<template>
  <LContainer>
    <fc-designer ref="designer" height="100%" @save="handleSave" :config="designerConfig" />
  </LContainer>
</template>
